<?php

/**
 * Created by PhpStorm.
 * User: xuezhileikaku
 * Email:chengyingbo88@163.com
 * Date: 2024/8/23
 * Time: 下午6:37
 */

namespace App\Service;

class ServiceRegistry
{
    private $services = [];

    public function register(string $name, string $address): void
    {
        $this->services[$name] = $address;
    }

    public function discover(string $name): ?string
    {
        return $this->services[$name] ?? null;
    }
}
